<template>
	<view class="content">
		<view class="head">
			<img :src="img" />
		</view>
		<view class="num">
			<view class="bg">
				{{list.length}}
				<text style="font-size: 32rpx;margin-left: 12rpx;">人</text>
			</view>
		</view>
		<view class="personList">
			<view class="list" v-if="list.length < 12" style="height: auto;">
				<view class="list_item" v-for="(item, index) in list" :key="index">
					<img :src="item.avatar" />
					<view class="name">{{item.nickName}}</view>
				</view>
			</view>
			<view class="list" :class="{ collapse: !flag }" v-else>
				<view class="list_item" v-for="(item, index) in list" :key="index">
					<img :src="item.avatar" />
					<view class="name">{{item.nickName}}</view>
				</view>
			</view>
			<view v-if="list.length > 12" class="model-footer" style="padding-bottom: 40rpx;" @click="flag = !flag">
				<view class="model-toggle" :class="{ expand: flag }">{{ flag ? '收起' : '展开' }}</view>
			</view>
		</view>
	</view>
</template>

<script>
import http from '@/common/request.js';
import { getCommonShareInfo } from '@/common/utils.js';
import mixLoadMore from '@/components/mix-load-more/mix-load-more';
export default{
	data() {
		return {
			img: 'https://domestic-rongchuang.oss-cn-beijing.aliyuncs.com/home/images/banner.png',
			num: '20',
			list: [],
			flag: false,
			pageNum: 1,
			pageSize: 10,
		}
	},
	mounted() {
		this.listNum()
	},
	onLoad() {
		uni.loadFontFace({
			family: 'hanyi',
			source: 'url("https://domestic-rongchuang.oss-cn-beijing.aliyuncs.com/home/images/HYQiHei-45S.otf")',
			success() {}
		});
	},
	methods: {
		listNum() {
			http('/api/cusUserInfo/todayShareUserPageList', { data: {pageNum: this.pageNum, pageSize: this.pageSize}, method: 'POST' }).then(
				result => {
					if(result.code == '200') {
						this.list = result.rows
					}
				}
			);
		}
	}
}
</script>

<style lang="less" scoped>
.content {
	position: relative;
	.head {
		img {
			height: 414rpx;
			width: 100%;
			position:relative;
			z-index: -5;
		}
	}
	.num {
		text-align: center;
		width: 100%;
		line-height: 360rpx;
		.bg {
			background: url(https://domestic-rongchuang.oss-cn-beijing.aliyuncs.com/home/images/yuan.png) center center no-repeat;
			background-size: 100% 100%;
			background-position:center center;
			width: 360rpx;
			height: 360rpx;
			position: absolute;
			z-index: 99;
			left: 50%;
			margin-left: -180rpx;
			top: 220rpx;
			font-size: 105rpx;
			color: #727171;
		}
	}
	.personList {
		background: #fff;
		margin: 0 28rpx;
		border-radius: 20rpx;
		padding-top: 62rpx;
		position: absolute;
		left: 0;
		right: 0;
		top: 380rpx;
		box-shadow: 0px 4px 10px rgba(102, 100, 93, 0.75) ;
		.list {
			display: flex;
			margin-top: 260rpx;
			align-content: space-between;
			flex-flow: wrap;
			overflow: hidden;
			.list_item {
				width: 25%;
				text-align: center;
				img {
					width: 92rpx;
					height: 92rpx;
					border-radius: 100%;
				}
				.name {
					margin: 24rpx 0 82rpx 0rpx;
					display: inline-block;
					color: #c6c7c7;
					width: 140rpx;
					overflow: hidden;
					text-overflow:ellipsis;
					white-space:nowrap;
					font-family: 'hanyi';
				}
			}
		}
		.collapse {
			height: 700rpx;
			overflow: hidden;
		}
		.model-footer {
			text-align: center;
			.model-toggle {
				text-align: center;
				font-size: 22rpx;
				font-weight: 400;
				color: #8a8c8d;
				line-height: 34rpx;
				padding-right: 30rpx;
				display: inline-block;
				background: url(//mall-rongchuang.oss-cn-beijing.aliyuncs.com/guixin_miniProgram/images/personal/pulldown_icon.png) no-repeat center right;
				background-size: 20rpx 23rpx;
			}
			.expand {
				background-image: url(//mall-rongchuang.oss-cn-beijing.aliyuncs.com/guixin_miniProgram/images/personal/pullup_icon.png) !important;
			}
		}
	}
	
}

</style>
